package br.com.naybee.framework.client.componente.gwt.web;

import com.google.gwt.dom.client.ImageElement;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.ComplexPanel;

public class Img extends ComplexPanel implements HasClickHandlers {

	private ImageElement imageElement = DOM.createImg().cast();

	public Img() {
		setElement(imageElement);
	}

	public void setSrc(String src) {
		imageElement.setSrc(src);
	}

	public HandlerRegistration addClickHandler(ClickHandler handler) {
		return addDomHandler(handler, ClickEvent.getType());
	}

}
